<@_sysTaskList status=status pageIndex=pageNum count=numPerPage>
<div class="pageHeader">
    <form class="pagerForm" onsubmit="return navTabSearch(this);" method="post">
        <#include "../include_page/parameters.html"/>
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label><@t.page 'status'/>:</label>
                    <select class="combox" name="status">
                        <option value=""${(!status?has_content)?then(' selected="true"','')?no_esc}><@t.page 'task.status'/></option>
                        <option value="0"${(status??&&"0"==status)?then(' selected="true"','')?no_esc}><@t.page 'status.task.'+0/></option>
                        <option value="1"${(status??&&"1"==status)?then(' selected="true"','')?no_esc}><@t.page 'status.task.'+1/></option>
                        <option value="2"${(status??&&"2"==status)?then(' selected="true"','')?no_esc}><@t.page 'status.task.'+2/></option>
                    </select>
                </li>
            </ul>
            <div class="subBar">
                <ul>
                    <li>
                        <button type="submit" class="buttonActive"><@t.page 'button.search'/></button>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a href="sysTask/add.html" target="navTab" rel="sysTask/add"><i class="icon-plus-sign-alt icon-large"></i> <@t.page 'task.add'/></a></li>
            <li><a href="sysTask/add.html?id={sid}" target="navTab" rel="sysTask/edit"><i class="icon-edit icon-large"></i> <@t.page 'task.edit'/></a></li>
            <li><a href="sysTask/delete.do?id={sid}&_csrf=<@_csrfToken admin=true/>" title="<@t.page 'confirm.delete'/>" target="ajaxTodo"><i class="icon-trash icon-large"></i> <@t.page 'button.delete'/></a></li>
        </ul>
    </div>
    <table class="list" width="100%" layoutH="99">
        <thead>
            <tr>
                <th width="30"><@t.page 'id'/></th>
                <th><@t.page 'name'/></th>
                <th><@t.page 'description'/></th>
                <th><@t.page 'task.cron'/></th>
                <th><@t.page 'task_template'/></th>
                <th><@t.page 'status'/></th>
                <th><@t.page 'operate'/></th>
            </tr>
        </thead>
        <tbody>
            <#list page.list as a>
            <tr target="sid" rel="${a.id}">
                <td>${a.id!}</td>
                <td>${(a.name)!}</td>
                <td>${(a.description)!}</td>
                <td>${(a.cronExpression)!}</td>
                <td>${(a.filePath)!}</td>
                <td><@t.page 'status.task.'+a.status/></td>
                <td>
                    <#if a.status=0>
                        <a href="sysTask/runOnce.do?id=${a.id}&_csrf=<@_csrfToken admin=true/>" title="<@t.page 'confirm.exec'/>" target="ajaxTodo"><@t.page 'button.exec'/></a>|
                        <a href="sysTask/pause.do?id=${a.id}&_csrf=<@_csrfToken admin=true/>" title="<@t.page 'confirm.pause'/>" target="ajaxTodo"><@t.page 'button.pause'/></a>|
                    <#elseif a.status=2>
                        <a href="sysTask/resume.do?id=${a.id}&_csrf=<@_csrfToken admin=true/>" title="<@t.page 'confirm.resume'/>" target="ajaxTodo"><@t.page 'button.resume'/></a>|
                    <#elseif a.status=3||a.status=1>
                        <a href="sysTask/recreate.do?id=${a.id}&_csrf=<@_csrfToken admin=true/>" title="<@t.page 'confirm.reinitialize'/>" target="ajaxTodo"><@t.page 'button.reinitialize'/></a>|
                    </#if>
                    <a href="log/task.html?taskId=${a.id}" target="navTab" rel="logTask" title="<@t.page 'log.task'/>"><@t.page 'button.view_log'/></a>
                </td>
            </tr>
            </#list>
        </tbody>
    </table>
    <#include "../include_page/page.html"/>
</div>
</@_sysTaskList>